package test.db.mysql.table;

public enum ExaminationPaperTable implements Table {
    SID(Column.sid),
    QUESTION_COUNT(Column.questionCount),
    SOLVE_TIME(Column.solveTime),
    CLASSIFICATION(Column.classification),
    MAKE_DATE(Column.makeDate),
    MAKE_TIME(Column.makeTime),
    EXAMINATION_DATE(Column.examinationDate),
    EXAMINATION_TIME(Column.examinationTime),
    SHARE_YN(Column.shareYn),
    USER_SID(Column.userSid),
    USE_YN(Column.useYn);
    
    private final Column column;
    private static final String TYPE_SID = "VARCHAR(20)";
    private static final String TYPE_QUESTION_COUNT = "INT(3)";
    private static final String TYPE_SOLVE_TIME = "VARCHAR(6)";
    private static final String TYPE_CLASSIFICATION = "VARCHAR(12)";
    private static final String TYPE_MAKE_DATE = "VARCHAR(8)";
    private static final String TYPE_MAKE_TIME = "VARCHAR(6)";
    private static final String TYPE_EXAMINATION_DATE = "VARCHAR(8)";
    private static final String TYPE_EXAMINATION_MAKE_TIME = "VARCHAR(6)";
    private static final String TYPE_SHARE_YN = "VARCHAR(1)";
    private static final String TYPE_USER_SID = "VARCHAR(20)";
    private static final String TYPE_USE_YN = "VARCHAR(1)";

    ExaminationPaperTable(Column column) {
        this.column = column;
    }
    
    private enum Column {
        sid {
            String getType() {
                return TYPE_SID;
            }
        },
        
        questionCount {
            String getType() {
                return TYPE_QUESTION_COUNT;
            }
        },
        
        solveTime {
            String getType() {
                return TYPE_SOLVE_TIME;
            }
        },
        
        classification {
            String getType() {
                return TYPE_CLASSIFICATION;
            }
        },
        
        makeDate {
            String getType() {
                return TYPE_MAKE_DATE;
            }
        },
        
        makeTime {
            String getType() {
                return TYPE_MAKE_TIME;
            }
        },
        
        examinationDate {
        	String getType() {
        		return TYPE_EXAMINATION_DATE;
        	}
        },
        
        examinationTime {
        	String getType() {
        		return TYPE_EXAMINATION_MAKE_TIME;
        	}
        },
        
        shareYn {
            String getType() {
                return TYPE_SHARE_YN;
            }
        },
        
        userSid {
        	String getType() {
        		return TYPE_USER_SID;
        	}
        },
        
        useYn {
        	String getType() {
        		return TYPE_USE_YN;
        	}
        };
        
        abstract String getType();
    }
    
    public String getType() {
        return column.getType();
    }
    
    public void initData() throws Exception {
        System.out.println("CALL NOW");
    }
}